<template>
<div>
  <h2 >{{ msg }}</h2>
  <h2>学生姓名：{{name}}</h2>
  <h2>学生性别：{{sex}}</h2>
  <h2>学生年龄：{{age+1}}</h2>
  <button @click="sendStuName">sendStuName</button>
  <button @click="deleteSJ">DeleteSJ</button>

</div>
</template>

<script>
export default {
  name: "Stu",
  data(){
    return {
      msg:'我是个学生',
      name:'Althan',
      sex:'男',
      age:15
    }
  },
  methods:{
    sendStuName() {
      //触发Stu组件实例身上的getStuName事件
      this.$emit('getStuName',this.name,1,2,3,5,8)
    },
    deleteSJ(){
      //删除多个自定义事件
      this.$off(['getStuName','demo1'])
      //全部解绑
      this.$off()
    }
  }
}
</script>

<style scoped>

</style>
